package com.bbx.taxi.client.Adapter;

import java.util.List;
import java.util.Map;

import com.bbx.taxi.official.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

/** 
 * @Path com.bbx.taxi.client.Adapter.PointAdapter.java
 * @Author 严旭文
 * @Date 2016-3-29 上午9:23:14
 * @Company 蓝海（福建）信息技术有限公司
 * @Description
 */
public class PointAdapter extends BaseAdapter {
	private List<String> list;
	private Context main;
	public PointAdapter(Context context,List<String> list) {
		this.list=list;
	   main=context;
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
		
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		ViewHolder viewholder;
		if(convertView==null){      
		LayoutInflater inflater=LayoutInflater.from(main);
		convertView=(View)inflater.inflate(R.layout.item_point,null);        
		viewholder=new ViewHolder();
		viewholder.tv_point=(TextView)convertView.findViewById(R.id.tv_point);		
		convertView.setTag(viewholder);	
		}
		else viewholder=(ViewHolder)convertView.getTag();
		viewholder.tv_point.setText(list.get(position));
		
		return convertView;
		
}
	public class ViewHolder{                   
		TextView tv_point;
	}
}
